#include<stdio.h>

typedef struct student
{
    char name[10];
    int score1;
    int score2;
    int score3;
    float ave;
}stu;

int main(void)
{
    stu s1;
    stu s2;
    stu s3;

    scanf("%s %d %d %d",s1.name,&s1.score1,&s1.score2,&s1.score3);
    scanf("%s %d %d %d",s2.name,&s2.score1,&s2.score2,&s2.score3);
    scanf("%s %d %d %d",s3.name,&s3.score1,&s3.score2,&s3.score3);

    s1.ave = (s1.score1+s1.score2+s1.score3)/3;
    s2.ave = (s2.score1+s2.score2+s2.score3)/3;
    s3.ave = (s3.score1+s3.score2+s3.score3)/3;

    int boo = 0;
    while (boo == 0)
    {
        stu temp;
        boo = 1;
        if (s1.ave<s2.ave)
        {
            temp = s1;
            s1 = s2;
            s2 = temp;
            boo = 0;
        }
        if (s2.ave<s3.ave)
        {
            temp = s2;
            s2 = s3;
            s3 = temp;
            boo = 0;
        }
    }
    printf("%s %.2f\n",s1.name,s1.ave);
    //printf("%s %.2f\n",s2.name,s2.ave);
    //printf("%s %.2f\n",s3.name,s3.ave);
}
